//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
   
  },
  //事件处理函数
  /*	          佛祖佑我组不再BUG     
                    _ooOoo_
	                  o8888888o
	                  88" . "88
	                  (| -_- |)
	                  O\  =  /O
	               ____/`---'\____
	             .'  \\|     |//  `.
	            /  \\|||  :  |||//  \
	           /  _||||| -:- |||||-  \
	           |   | \\\  -  /// |   |
	           | \_|  ''\-/''  |   |
	           \  .-\__  `-`  ___/-. /
	         ___`. .'  /-.-\  `. . __
	      ."" '<  `.___\_<|>_/___.'  >'"".
	     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
	     \  \ `-.   \_ __\ /__ _/   .-` /  /
	======`-.____`-.___\_____/___.-`____.-'======
	                   `=-='
                 佛祖佑我组不再BUG
*/
  onLoad: function (options) {
    this.isLogin();
  },
   isLogin:function(){
     var name = wx.getStorageSync('name')
     var id = wx.getStorageSync('id')
     var role="学生"
     console.log(name)
     console.log(id)
     console.log(wx.getStorageSync('role'))
     if(name){
       if (role != wx.getStorageSync('role')){
         wx.navigateTo({
           url: "../teacherAcPage/teacherAcPage?id="+id+"&name="+name,
         })
       }else{
         wx.navigateTo({
           url: "../studentAcPage/studentAcPage?id=" + id + "&name=" + name,
         })
       }
     }
   },


  jumpToteacherLogPage: function(){
    wx.navigateTo({
      url:'../teacherLogPage/teacherLogPage',
    })
  },
   jumpTostudentLogPage: function () {
    wx.navigateTo({
      url: '../studentLogPage/studentLogPage',
    })
  },
   jumpTostudentAcPage: function () {
    wx.navigateTo({
      url: '../studentAcPage/studentAcPage',
    })
  },
  jumpToteacherAcPage: function () {
    wx.navigateTo({
      url: '../teacherAcPage/teacherAcPage',
    })
  }
})
